{"ast":null,"code":"import _defineProperty from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nvar __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) {\n    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  }\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport classNames from 'classnames';\nimport FieldForm, { List, useWatch } from 'rc-field-form';\nimport * as React from 'react';\nimport { useMemo } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext, { DisabledContextProvider } from '../config-provider/DisabledContext';\nimport SizeContext, { SizeContextProvider } from '../config-provider/SizeContext';\nimport { FormContext } from './context';\nimport useForm from './hooks/useForm';\nimport useStyle from './style';\nvar InternalForm = function InternalForm(props, ref) {\n  var _classNames;\n  var contextSize = React.useContext(SizeContext);\n  var contextDisabled = React.useContext(DisabledContext);\n  var _React$useContext = React.useContext(ConfigContext),\n    getPrefixCls = _React$useContext.getPrefixCls,\n    direction = _React$useContext.direction,\n    contextForm = _React$useContext.form;\n  var customizePrefixCls = props.prefixCls,\n    _props$className = props.className,\n    className = _props$className === void 0 ? '' : _props$className,\n    _props$size = props.size,\n    size = _props$size === void 0 ? contextSize : _props$size,\n    _props$disabled = props.disabled,\n    disabled = _props$disabled === void 0 ? contextDisabled : _props$disabled,\n    form = props.form,\n    colon = props.colon,\n    labelAlign = props.labelAlign,\n    labelWrap = props.labelWrap,\n    labelCol = props.labelCol,\n    wrapperCol = props.wrapperCol,\n    hideRequiredMark = props.hideRequiredMark,\n    _props$layout = props.layout,\n    layout = _props$layout === void 0 ? 'horizontal' : _props$layout,\n    scrollToFirstError = props.scrollToFirstError,\n    requiredMark = props.requiredMark,\n    onFinishFailed = props.onFinishFailed,\n    name = props.name,\n    restFormProps = __rest(props, [\"prefixCls\", \"className\", \"size\", \"disabled\", \"form\", \"colon\", \"labelAlign\", \"labelWrap\", \"labelCol\", \"wrapperCol\", \"hideRequiredMark\", \"layout\", \"scrollToFirstError\", \"requiredMark\", \"onFinishFailed\", \"name\"]);\n  var mergedRequiredMark = useMemo(function () {\n    if (requiredMark !== undefined) {\n      return requiredMark;\n    }\n    if (contextForm && contextForm.requiredMark !== undefined) {\n      return contextForm.requiredMark;\n    }\n    if (hideRequiredMark) {\n      return false;\n    }\n    return true;\n  }, [hideRequiredMark, requiredMark, contextForm]);\n  var mergedColon = colon !== null && colon !== void 0 ? colon : contextForm === null || contextForm === void 0 ? void 0 : contextForm.colon;\n  var prefixCls = getPrefixCls('form', customizePrefixCls);\n  // Style\n  var _useStyle = useStyle(prefixCls),\n    _useStyle2 = _slicedToArray(_useStyle, 2),\n    wrapSSR = _useStyle2[0],\n    hashId = _useStyle2[1];\n  var formClassName = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(layout), true), _defineProperty(_classNames, \"\".concat(prefixCls, \"-hide-required-mark\"), mergedRequiredMark === false), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(size), size), _classNames), hashId, className);\n  var _useForm = useForm(form),\n    _useForm2 = _slicedToArray(_useForm, 1),\n    wrapForm = _useForm2[0];\n  var __INTERNAL__ = wrapForm.__INTERNAL__;\n  __INTERNAL__.name = name;\n  var formContextValue = useMemo(function () {\n    return {\n      name: name,\n      labelAlign: labelAlign,\n      labelCol: labelCol,\n      labelWrap: labelWrap,\n      wrapperCol: wrapperCol,\n      vertical: layout === 'vertical',\n      colon: mergedColon,\n      requiredMark: mergedRequiredMark,\n      itemRef: __INTERNAL__.itemRef,\n      form: wrapForm\n    };\n  }, [name, labelAlign, labelCol, wrapperCol, layout, mergedColon, mergedRequiredMark, wrapForm]);\n  React.useImperativeHandle(ref, function () {\n    return wrapForm;\n  });\n  var onInternalFinishFailed = function onInternalFinishFailed(errorInfo) {\n    onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errorInfo);\n    var defaultScrollToFirstError = {\n      block: 'nearest'\n    };\n    if (scrollToFirstError && errorInfo.errorFields.length) {\n      if (typeof scrollToFirstError === 'object') {\n        defaultScrollToFirstError = scrollToFirstError;\n      }\n      wrapForm.scrollToField(errorInfo.errorFields[0].name, defaultScrollToFirstError);\n    }\n  };\n  return wrapSSR( /*#__PURE__*/React.createElement(DisabledContextProvider, {\n    disabled: disabled\n  }, /*#__PURE__*/React.createElement(SizeContextProvider, {\n    size: size\n  }, /*#__PURE__*/React.createElement(FormContext.Provider, {\n    value: formContextValue\n  }, /*#__PURE__*/React.createElement(FieldForm, Object.assign({\n    id: name\n  }, restFormProps, {\n    name: name,\n    onFinishFailed: onInternalFinishFailed,\n    form: wrapForm,\n    className: formClassName\n  }))))));\n};\nvar Form = /*#__PURE__*/React.forwardRef(InternalForm);\nexport { useForm, List, useWatch };\nexport default Form;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","classNames","FieldForm","List","useWatch","React","useMemo","ConfigContext","DisabledContext","DisabledContextProvider","SizeContext","SizeContextProvider","FormContext","useForm","useStyle","InternalForm","props","ref","contextSize","useContext","contextDisabled","getPrefixCls","direction","contextForm","form","customizePrefixCls","prefixCls","className","size","disabled","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","restFormProps","mergedRequiredMark","undefined","mergedColon","wrapSSR","hashId","formClassName","wrapForm","__INTERNAL__","formContextValue","vertical","itemRef","useImperativeHandle","onInternalFinishFailed","errorInfo","defaultScrollToFirstError","block","errorFields","scrollToField","createElement","Provider","value","assign","id","Form","forwardRef"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/form/Form.js"],"sourcesContent":["var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport classNames from 'classnames';\nimport FieldForm, { List, useWatch } from 'rc-field-form';\nimport * as React from 'react';\nimport { useMemo } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext, { DisabledContextProvider } from '../config-provider/DisabledContext';\nimport SizeContext, { SizeContextProvider } from '../config-provider/SizeContext';\nimport { FormContext } from './context';\nimport useForm from './hooks/useForm';\nimport useStyle from './style';\nconst InternalForm = (props, ref) => {\n  const contextSize = React.useContext(SizeContext);\n  const contextDisabled = React.useContext(DisabledContext);\n  const {\n    getPrefixCls,\n    direction,\n    form: contextForm\n  } = React.useContext(ConfigContext);\n  const {\n      prefixCls: customizePrefixCls,\n      className = '',\n      size = contextSize,\n      disabled = contextDisabled,\n      form,\n      colon,\n      labelAlign,\n      labelWrap,\n      labelCol,\n      wrapperCol,\n      hideRequiredMark,\n      layout = 'horizontal',\n      scrollToFirstError,\n      requiredMark,\n      onFinishFailed,\n      name\n    } = props,\n    restFormProps = __rest(props, [\"prefixCls\", \"className\", \"size\", \"disabled\", \"form\", \"colon\", \"labelAlign\", \"labelWrap\", \"labelCol\", \"wrapperCol\", \"hideRequiredMark\", \"layout\", \"scrollToFirstError\", \"requiredMark\", \"onFinishFailed\", \"name\"]);\n  const mergedRequiredMark = useMemo(() => {\n    if (requiredMark !== undefined) {\n      return requiredMark;\n    }\n    if (contextForm && contextForm.requiredMark !== undefined) {\n      return contextForm.requiredMark;\n    }\n    if (hideRequiredMark) {\n      return false;\n    }\n    return true;\n  }, [hideRequiredMark, requiredMark, contextForm]);\n  const mergedColon = colon !== null && colon !== void 0 ? colon : contextForm === null || contextForm === void 0 ? void 0 : contextForm.colon;\n  const prefixCls = getPrefixCls('form', customizePrefixCls);\n  // Style\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const formClassName = classNames(prefixCls, {\n    [`${prefixCls}-${layout}`]: true,\n    [`${prefixCls}-hide-required-mark`]: mergedRequiredMark === false,\n    [`${prefixCls}-rtl`]: direction === 'rtl',\n    [`${prefixCls}-${size}`]: size\n  }, hashId, className);\n  const [wrapForm] = useForm(form);\n  const {\n    __INTERNAL__\n  } = wrapForm;\n  __INTERNAL__.name = name;\n  const formContextValue = useMemo(() => ({\n    name,\n    labelAlign,\n    labelCol,\n    labelWrap,\n    wrapperCol,\n    vertical: layout === 'vertical',\n    colon: mergedColon,\n    requiredMark: mergedRequiredMark,\n    itemRef: __INTERNAL__.itemRef,\n    form: wrapForm\n  }), [name, labelAlign, labelCol, wrapperCol, layout, mergedColon, mergedRequiredMark, wrapForm]);\n  React.useImperativeHandle(ref, () => wrapForm);\n  const onInternalFinishFailed = errorInfo => {\n    onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errorInfo);\n    let defaultScrollToFirstError = {\n      block: 'nearest'\n    };\n    if (scrollToFirstError && errorInfo.errorFields.length) {\n      if (typeof scrollToFirstError === 'object') {\n        defaultScrollToFirstError = scrollToFirstError;\n      }\n      wrapForm.scrollToField(errorInfo.errorFields[0].name, defaultScrollToFirstError);\n    }\n  };\n  return wrapSSR( /*#__PURE__*/React.createElement(DisabledContextProvider, {\n    disabled: disabled\n  }, /*#__PURE__*/React.createElement(SizeContextProvider, {\n    size: size\n  }, /*#__PURE__*/React.createElement(FormContext.Provider, {\n    value: formContextValue\n  }, /*#__PURE__*/React.createElement(FieldForm, Object.assign({\n    id: name\n  }, restFormProps, {\n    name: name,\n    onFinishFailed: onInternalFinishFailed,\n    form: wrapForm,\n    className: formClassName\n  }))))));\n};\nconst Form = /*#__PURE__*/React.forwardRef(InternalForm);\nexport { useForm, List, useWatch };\nexport default Form;"],"mappings":";;AAAA,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC;IAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAAC;EACjG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAAE,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEP,CAAC,GAAGC,MAAM,CAACK,qBAAqB,CAACT,CAAC,CAAC,EAAEU,CAAC,GAAGP,CAAC,CAACQ,MAAM,EAAED,CAAC,EAAE,EAAE;IAC3I,IAAIT,CAAC,CAACO,OAAO,CAACL,CAAC,CAACO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAIN,MAAM,CAACC,SAAS,CAACO,oBAAoB,CAACL,IAAI,CAACP,CAAC,EAAEG,CAAC,CAACO,CAAC,CAAC,CAAC,EAAER,CAAC,CAACC,CAAC,CAACO,CAAC,CAAC,CAAC,GAAGV,CAAC,CAACG,CAAC,CAACO,CAAC,CAAC,CAAC;EACnG;EACA,OAAOR,CAAC;AACV,CAAC;AACD,OAAOW,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,eAAe;AACzD,OAAO,KAAKC,KAAK,MA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